Learn R Programming

spectrolab (version 0.0.18)

[<-.spectra: Assign values to spectra

Description

`[<-` assigns the rhs values to spectra

Usage

# S3 method for spectra
[(x, i, j) <- value

Value

nothing. modifies spectra as side effect

Arguments

x

spectra object (lhs)

i

Sample names (preferred), index, or a logical vector of length nrow(x)

j

band labels, as numeric or character or a logical vector of length ncol(x). Do not use indexes!

value

value to be assigned (rhs). Must either data coercible to numeric or another `spectra` obj

Author

Jose Eduardo Meireles

Examples

Run this code
library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
spec[ , 400:500] = spec[ , 400:500] * 1.2
spec

Run the code above in your browser using DataLab